package com.foldingleaf.order.service.impl;

import java.util.List;
import com.foldingleaf.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.foldingleaf.order.mapper.SysCollectionOrderMapper;
import com.foldingleaf.order.domain.SysCollectionOrder;
import com.foldingleaf.order.service.ISysCollectionOrderService;

/**
 * 藏品订单Service业务层处理
 * 
 * @author ajian
 * @date 2022-06-02
 */
@Service
public class SysCollectionOrderServiceImpl implements ISysCollectionOrderService 
{
    @Autowired
    private SysCollectionOrderMapper sysCollectionOrderMapper;

    /**
     * 查询藏品订单
     * 
     * @param collectionOrderId 藏品订单主键
     * @return 藏品订单
     */
    @Override
    public SysCollectionOrder selectSysCollectionOrderByCollectionOrderId(Long collectionOrderId)
    {
        return sysCollectionOrderMapper.selectSysCollectionOrderByCollectionOrderId(collectionOrderId);
    }

    /**
     * 查询藏品订单列表
     * 
     * @param sysCollectionOrder 藏品订单
     * @return 藏品订单
     */
    @Override
    public List<SysCollectionOrder> selectSysCollectionOrderList(SysCollectionOrder sysCollectionOrder)
    {
        return sysCollectionOrderMapper.selectSysCollectionOrderList(sysCollectionOrder);
    }

    /**
     * 新增藏品订单
     * 
     * @param sysCollectionOrder 藏品订单
     * @return 结果
     */
    @Override
    public int insertSysCollectionOrder(SysCollectionOrder sysCollectionOrder)
    {
        sysCollectionOrder.setCreateTime(DateUtils.getNowDate());
        return sysCollectionOrderMapper.insertSysCollectionOrder(sysCollectionOrder);
    }

    /**
     * 修改藏品订单
     * 
     * @param sysCollectionOrder 藏品订单
     * @return 结果
     */
    @Override
    public int updateSysCollectionOrder(SysCollectionOrder sysCollectionOrder)
    {
        return sysCollectionOrderMapper.updateSysCollectionOrder(sysCollectionOrder);
    }

    /**
     * 批量删除藏品订单
     * 
     * @param collectionOrderIds 需要删除的藏品订单主键
     * @return 结果
     */
    @Override
    public int deleteSysCollectionOrderByCollectionOrderIds(Long[] collectionOrderIds)
    {
        return sysCollectionOrderMapper.deleteSysCollectionOrderByCollectionOrderIds(collectionOrderIds);
    }

    /**
     * 删除藏品订单信息
     * 
     * @param collectionOrderId 藏品订单主键
     * @return 结果
     */
    @Override
    public int deleteSysCollectionOrderByCollectionOrderId(Long collectionOrderId)
    {
        return sysCollectionOrderMapper.deleteSysCollectionOrderByCollectionOrderId(collectionOrderId);
    }
}
